<%@ Page Language="C#" MasterPageFile="~/Masterpages/Default.master" AutoEventWireup="true" Inherits="protected_ManagePages" Title="Manage Pages" Codebehind="ManagePages.aspx.cs" %>

<%@ Register Src="../Usercontrols/ChooseSite.ascx" TagName="ChooseSite" TagPrefix="uc2" %>

<%@ Register Src="../Usercontrols/SelectSite.ascx" TagName="SelectSite" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<h1>
    Manage Site Pages</h1>
    <uc2:ChooseSite id="ChooseSite1" runat="server">
    </uc2:ChooseSite><hr />
    <div class="Filter">Name: <asp:TextBox ID="TextBoxFilterName" runat="server" Width="259px"></asp:TextBox> Tags:
    <asp:TextBox ID="TextBoxFilterTags" runat="server" Width="234px"></asp:TextBox>
    <ajax:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server"  
    CompletionInterval="100" MinimumPrefixLength="2" 
    DelimiterCharacters=",;:/" ServicePath="~/AjaxFunctions.asmx" 
    CompletionSetCount="10" UseContextKey="false"
    ServiceMethod="AutoCompleteTag" TargetControlID="TextBoxFilterTags" 
    EnableCaching="True">
</ajax:AutoCompleteExtender>
    <asp:Button ID="ButtonFilter" runat="server" onclick="ButtonFilter_Click" 
        Text="Filter" /></div>
        <div class="grid">
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
            CellPadding="4" DataSourceID="odsSitePages" 
            EmptyDataText="There are no pages in this site yet" 
            DataKeyNames="ID,RowStamp,RowState" Width="100%" AllowSorting="True" 
            PageSize="50">
            <PagerSettings Mode="NumericFirstLast" Position="TopAndBottom" />
            <Columns>
                <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" />
                <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
                <asp:BoundField DataField="Url" HeaderText="Url" SortExpression="Url" />
                <asp:BoundField DataField="Comments" HeaderText="Comments" SortExpression="Comments" />
                <asp:CheckBoxField DataField="IsActive" HeaderText="IsActive" SortExpression="IsActive" />
                <asp:HyperLinkField DataNavigateUrlFields="ID" DataNavigateUrlFormatString="~/protected/EditPage.aspx?pageId={0}"
                    Text="Edit" />
                <asp:CommandField ShowDeleteButton="True" />
            </Columns>
        </asp:GridView>
        </div>
    <p>
        <asp:HyperLink ID="HyperLinkCreatePage" runat="server" NavigateUrl="~/protected/EditPage.aspx?pageId=">Create 
        page</asp:HyperLink>&nbsp;
    </p>
        <asp:ObjectDataSource ID="odsSitePages" runat="server" DataObjectTypeName="Blazing.BusinessObjects.Cms.Contentpage"
            DeleteMethod="DeletePage" InsertMethod="NewPage" OldValuesParameterFormatString="original_{0}"
            SelectMethod="GetPages" 
    TypeName="Blazing.WebFacade.PageController" UpdateMethod="UpdatePage" 
    SortParameterName="sortExpression">
            <SelectParameters>
                <asp:SessionParameter Name="siteId" SessionField="siteId" Type="Int32" />
                <asp:ControlParameter ControlID="TextBoxFilterName" Name="filter" 
                    PropertyName="Text" />
                <asp:ControlParameter ControlID="TextBoxFilterTags" Name="tags" 
                    PropertyName="Text" />
            </SelectParameters>
        </asp:ObjectDataSource>
<hr />
        <br />
</asp:Content>

